import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

//数组
const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import("../views/login.vue")
  },
  {
    path: '/',
    name: 'home',
    redirect:'/admin',
    component: () => import("../views/home.vue"),
    children: [
      {
        path: '/admin',
        name: 'admin',
        component: () => import("../views/admin/admin.vue"),
        meta:{
          title:'用户管理'
        }
      },
      {
        path: '/role',
        name: 'role',
        component: () => import("../views/role/role.vue"),
        meta:{
          title:'角色管理'
        }
      },
      {
        path: '/menu',
        name: 'menu',
        component: () => import("../views/menu/menu.vue"),
        meta:{
          title:'菜单管理'
        }
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router